<?php

/**
 * @author abcde
 * @copyright 2011
 */
require_once "conn.php";
session_start();

$email=$_POST["email"];
echo($email);
$pass=$_POST["pass"];
$exec="select * from user where email='".$email."'";
if ($result=mysql_query($exec))
{
    if ($rs=mysql_fetch_object($result))
    {
        if ($rs->pass==$pass)
        {
            $_SESSION['loginemail']=$email;
            header("location:index.php");
        }
        else
        {
            echo "<script>alert('pass check error');location.href='login.php';</script>";
        }
    }
    else
    {
        echo "<script>alert('email check error');location.href='login.php';</script>";        
    }
}
else
{
    echo "<script>alert('Database connection error');location.href='login.php';</script>";
}
?>